use md5::{Digest, Md5};

fn main() {
    // create a Md5 hasher instance
    let mut hasher = Md5::new();

    let mut str = String::from("73.25%");
    let now = std::time::Instant::now();

    for i in 0..100000000 {
        // process input message
        hasher.update(str.as_bytes());

        // acquire hash digest in the form of GenericArray,
        // which in this case is equivalent to [u8; 16]
        let result = hasher.finalize_reset();
        str = format!("{:x}", result);
        if i % 1000000 == 0 {
            println!("{} {}ms: {:x}", i, now.elapsed().as_millis(), result);
        }
    }

    println!("{}", str);
    // println!("{}", hex!("5eb63bbbe01eeed093cb22bb8f5acdc3"));
    // assert_eq!(result[..], );
}
